package com.uenpay.service.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Author: liulou
 * Date: 2017/6/6.
 * desc:
 */

public class BankCardInfo implements Parcelable {

    /**
     * userBankId  : 5
     * bankName : 银行卡名称
     * bankNo : 308584000013
     * cardNo : 6225757547024837
     * cardType : 卡类型1是借记卡；2是信用卡
     * expireDate : 2102
     */

    private int userBankId;
    private String bankName;
    private String bankNo;
    private String cardNo;
    private String cardType;
    private String expireDate;
    private String cvvCode;
    private String userName;
    private String phone;

    public BankCardInfo(){}
    protected BankCardInfo(Parcel in) {
        userBankId = in.readInt();
        bankName = in.readString();
        bankNo = in.readString();
        cardNo = in.readString();
        cardType = in.readString();
        expireDate = in.readString();
        cvvCode = in.readString();
        userName = in.readString();
        phone = in.readString();
        isDefault = in.readByte() != 0;
    }

    public static final Creator<BankCardInfo> CREATOR = new Creator<BankCardInfo>() {
        @Override
        public BankCardInfo createFromParcel(Parcel in) {
            return new BankCardInfo(in);
        }

        @Override
        public BankCardInfo[] newArray(int size) {
            return new BankCardInfo[size];
        }
    };

    public boolean isDefault() {
        return isDefault;
    }

    public void setDefault(boolean aDefault) {
        isDefault = aDefault;
    }

    public boolean isDefault;//是否默认银行卡


    public int getUserBankId() {
        return userBankId;
    }

    public void setUserBankId(int userBankId) {
        this.userBankId = userBankId;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getBankNo() {
        return bankNo;
    }

    public void setBankNo(String bankNo) {
        this.bankNo = bankNo;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public String getCardType() {
        return cardType;
    }

    public void setCardType(String cardType) {
        this.cardType = cardType;
    }

    public String getExpireDate() {
        return expireDate;
    }

    public void setExpireDate(String expireDate) {
        this.expireDate = expireDate;
    }


    public String getCvvCode() {
        return cvvCode;
    }

    public void setCvvCode(String cvvCode) {
        this.cvvCode = cvvCode;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Override
    public String toString() {
        return "BankCardInfo{" +
                "isDefault=" + isDefault +
                "userBankId=" + userBankId +
                ", bankName='" + bankName + '\'' +
                ", bankNo='" + bankNo + '\'' +
                ", cardNo='" + cardNo + '\'' +
                ", cardType='" + cardType + '\'' +
                ", expireDate='" + expireDate + '\'' +
                ", cvvCode='" + cvvCode + '\'' +
                ", userName='" + userName + '\'' +
                ", phone='" + phone + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(userBankId);
        dest.writeString(bankName);
        dest.writeString(bankNo);
        dest.writeString(cardNo);
        dest.writeString(cardType);
        dest.writeString(expireDate);
        dest.writeString(cvvCode);
        dest.writeString(userName);
        dest.writeString(phone);
        dest.writeByte((byte) (isDefault ? 1 : 0));
    }
}
